<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <canvas id="canvas" width="600" height="600">
        an alternative text describing what your canvas displays.
    </canvas>
    <script>
        var canvas = document.getElementById("canvas");
        // 让canvas模糊化设置alpha:false
        var ctx = canvas.getContext("2d", { alpha: false});
        ctx.fillStyle = "green";
        ctx.fillRect(10, 10, 100, 100);

    </script>
</body>
</html>